<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    数据发生变化的时候addEventListener才能监听到<br>
    
    <a href="https://xv700.gitee.io/message-communication-for-web/localStorage/accept.html" target="_blank">点击打开接受页面</a>
<input type="text" value="" id="va">
<input type="button" onclick="send()" value="发送消息给accept.html">
    <script type="text/javascript">
    function send()
    {   
        localStorage.setItem("MSG",document.getElementById("va").value)
    }
    </script>
</body>
</html>